package cn.aspart.validation.bean;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author aspart
 * @date 2020/10/21
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class AnimalBean {

    @NotNull(message = "name 不能为空")
    @Size(min = 6, max = 16, message = "name 长度介于 [6,16]")
    private String name;

    @Min(value = 1, message = "type 不能小于1")
    @Max(value = 10, message = "type 不能大于10")
    private int type;

    @Size(min = 1, max = 2, message = "features 长度介于 [1,2]")
    private List<String> features;
}
